<ul id='main-site-globalbo-moduleSpace-flat-detail-pictures-ul'>
  <?php foreach($data['pictures'] as $k1=>$v1): ?>
    <li class='main-site-globalbo-moduleSpace-flat-detail-pictures-li'>
      <img class="show-big_picture" src="<?php echo $data['baseurl']; ?>global/img/appartements/pictures/thumbnails/<?php echo $v1; ?>" alt='image'>
      <div class='pictures-detail'>
        <span class='item'>
          <img class='pictures-detail-delete' src='<?php echo $data['baseurl']; ?>global/img/globalbo/appartements/delete-128.png' alt='Supprimer'>
          <input type='hidden' class='pictures-detail-pic' name='id_pic' value="<?php echo $v1; ?>">
        </span> 
        <span class='item'>
          <img class='pictures-detail-show' src='<?php echo $data['baseurl']; ?>global/img/globalbo/appartements/search-128.png' alt='Afficher en grand'>
          <input type='hidden' class='pictures-detail-pic' name='id_pic' value="<?php echo $v1; ?>">
        </span> 
        
      </div>      
    </li>
  <?php endforeach; ?>
</ul>

<script type="text/javascript">
showPicture = function(){
        var id_pic = $(this).siblings('.pictures-detail-pic').val();
        $('#component-show-image-img').attr('src', '<?php echo $data['baseurl']; ?>global/img/appartements/pictures/'+id_pic);
        $("#component-show-image").show();
      }

$(".pictures-detail-delete").click(function(){
  var id_appart = $("#appart_id_modif").val().replace("appart_", "");
  var id_pic = $(this).siblings('.pictures-detail-pic').val();
  url="<?php echo $data['baseurl']; ?>admin/frbFlat/frbFlat_MainController/appartements";
  if(confirm("Etes-vous sûr de vouloir supprimer\n\t\tcette photo")){
    $.ajax({
      urlApp: url,
      type: 'POST',
      cache: false,
      data: "del_picture=true&id_flat="+id_appart+"&id_pic="+id_pic,
      success: function(html){
        loadPictures(id_appart);
      }
    });
  }
});


$(".pictures-detail-show").click(showPicture);
$('.show-big_picture').click(function(){
  var picture = $(this).attr("src");
  picture = picture.replace("thumbnails/", "");
  $('#component-show-image-img').attr('src', picture);
  $("#component-show-image").show();
});


</script>